package com.graduation.lastproject.service.hotellist.impl;

import com.graduation.lastproject.dao.hotellist.HotellistDao;
import com.graduation.lastproject.entity.HotelInfo;
import com.graduation.lastproject.service.hotellist.HotellistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class IHotellistService implements HotellistService{

    @Autowired
    HotellistDao hotellistDao;

    @Override
    public List<HotelInfo> getAllInfo(Map<String, Object> map) {
        return hotellistDao.getAllInfo(map);
    }

    @Override
    public HotelInfo getAllInfoById(String hotelId) {
        return hotellistDao.getAllInfoById(hotelId);
    }

    @Override
    public void updataHotelNumInfo(String hotelId, String hotelRoomType) {
        hotellistDao.updataHotelNumInfo(hotelId,hotelRoomType);
    }

    @Override
    public void updataUserInfo(Map<String, Object> map) {
        hotellistDao.updataUserInfo(map);
    }

    @Override
    public List<Map<String, Object>> getAllReviewInfo(String hotelId) {
        return hotellistDao.getAllReviewInfo(hotelId);
    }

    @Override
    public void deleteOrderInfo(String trade_out) {
     hotellistDao.deleteOrderInfo(trade_out);
    }

    @Override
    public void updateUserIntegral(Object userPhone, Object total_price) {
        hotellistDao.updataUserIntegral(userPhone,total_price);
    }

    @Override
    public void updataHotel(String hotelId, int hotelRoomType) {
        hotellistDao.updataHotelNumInfo1(hotelId,hotelRoomType);
    }

    @Override
    public int insertBookHotelInfo(Map<String, Object> map) {
        return hotellistDao.insertBookHotelInfo(map);
    }

    @Override
    public int updataBookOrderInfo(Map<String, Object> map) {
        return hotellistDao.updataBookOrderInfo(map);
    }
}
